{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Bokeh\n",
    "[working in notebook](https://bokeh.pydata.org/en/latest/docs/user_guide/notebook.html)\n",
    "\n",
    "[bokeh notebook examples](https://github.com/bokeh/bokeh-notebooks)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from bokeh.io import output_notebook, show\n",
    "from bokeh.plotting import figure"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "    <div class=\"bk-root\">\n",
       "        <a href=\"https://bokeh.pydata.org\" target=\"_blank\" class=\"bk-logo bk-logo-small bk-logo-notebook\"></a>\n",
       "        <span id=\"1001\">Loading BokehJS ...</span>\n",
       "    </div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "(function(root) {\n",
       "  function now() {\n",
       "    return new Date();\n",
       "  }\n",
       "\n",
       "  var force = true;\n",
       "\n",
       "  if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n",
       "    root._bokeh_onload_callbacks = [];\n",
       "    root._bokeh_is_loading = undefined;\n",
       "  }\n",
       "\n",
       "  var JS_MIME_TYPE = 'application/javascript';\n",
       "  var HTML_MIME_TYPE = 'text/html';\n",
       "  var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n",
       "  var CLASS_NAME = 'output_bokeh rendered_html';\n",
       "\n",
       "  /**\n",
       "   * Render data to the DOM node\n",
       "   */\n",
       "  function render(props, node) {\n",
       "    var script = document.createElement(\"script\");\n",
       "    node.appendChild(script);\n",
       "  }\n",
       "\n",
       "  /**\n",
       "   * Handle when an output is cleared or removed\n",
       "   */\n",
       "  function handleClearOutput(event, handle) {\n",
       "    var cell = handle.cell;\n",
       "\n",
       "    var id = cell.output_area._bokeh_element_id;\n",
       "    var server_id = cell.output_area._bokeh_server_id;\n",
       "    // Clean up Bokeh references\n",
       "    if (id != null && id in Bokeh.index) {\n",
       "      Bokeh.index[id].model.document.clear();\n",
       "      delete Bokeh.index[id];\n",
       "    }\n",
       "\n",
       "    if (server_id !== undefined) {\n",
       "      // Clean up Bokeh references\n",
       "      var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n",
       "      cell.notebook.kernel.execute(cmd, {\n",
       "        iopub: {\n",
       "          output: function(msg) {\n",
       "            var id = msg.content.text.trim();\n",
       "            if (id in Bokeh.index) {\n",
       "              Bokeh.index[id].model.document.clear();\n",
       "              delete Bokeh.index[id];\n",
       "            }\n",
       "          }\n",
       "        }\n",
       "      });\n",
       "      // Destroy server and session\n",
       "      var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n",
       "      cell.notebook.kernel.execute(cmd);\n",
       "    }\n",
       "  }\n",
       "\n",
       "  /**\n",
       "   * Handle when a new output is added\n",
       "   */\n",
       "  function handleAddOutput(event, handle) {\n",
       "    var output_area = handle.output_area;\n",
       "    var output = handle.output;\n",
       "\n",
       "    // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n",
       "    if ((output.output_type != \"display_data\") || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n",
       "      return\n",
       "    }\n",
       "\n",
       "    var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n",
       "\n",
       "    if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n",
       "      toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n",
       "      // store reference to embed id on output_area\n",
       "      output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n",
       "    }\n",
       "    if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n",
       "      var bk_div = document.createElement(\"div\");\n",
       "      bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n",
       "      var script_attrs = bk_div.children[0].attributes;\n",
       "      for (var i = 0; i < script_attrs.length; i++) {\n",
       "        toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n",
       "      }\n",
       "      // store reference to server id on output_area\n",
       "      output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n",
       "    }\n",
       "  }\n",
       "\n",
       "  function register_renderer(events, OutputArea) {\n",
       "\n",
       "    function append_mime(data, metadata, element) {\n",
       "      // create a DOM node to render to\n",
       "      var toinsert = this.create_output_subarea(\n",
       "        metadata,\n",
       "        CLASS_NAME,\n",
       "        EXEC_MIME_TYPE\n",
       "      );\n",
       "      this.keyboard_manager.register_events(toinsert);\n",
       "      // Render to node\n",
       "      var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n",
       "      render(props, toinsert[toinsert.length - 1]);\n",
       "      element.append(toinsert);\n",
       "      return toinsert\n",
       "    }\n",
       "\n",
       "    /* Handle when an output is cleared or removed */\n",
       "    events.on('clear_output.CodeCell', handleClearOutput);\n",
       "    events.on('delete.Cell', handleClearOutput);\n",
       "\n",
       "    /* Handle when a new output is added */\n",
       "    events.on('output_added.OutputArea', handleAddOutput);\n",
       "\n",
       "    /**\n",
       "     * Register the mime type and append_mime function with output_area\n",
       "     */\n",
       "    OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n",
       "      /* Is output safe? */\n",
       "      safe: true,\n",
       "      /* Index of renderer in `output_area.display_order` */\n",
       "      index: 0\n",
       "    });\n",
       "  }\n",
       "\n",
       "  // register the mime type if in Jupyter Notebook environment and previously unregistered\n",
       "  if (root.Jupyter !== undefined) {\n",
       "    var events = require('base/js/events');\n",
       "    var OutputArea = require('notebook/js/outputarea').OutputArea;\n",
       "\n",
       "    if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n",
       "      register_renderer(events, OutputArea);\n",
       "    }\n",
       "  }\n",
       "\n",
       "  \n",
       "  if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n",
       "    root._bokeh_timeout = Date.now() + 5000;\n",
       "    root._bokeh_failed_load = false;\n",
       "  }\n",
       "\n",
       "  var NB_LOAD_WARNING = {'data': {'text/html':\n",
       "     \"<div style='background-color: #fdd'>\\n\"+\n",
       "     \"<p>\\n\"+\n",
       "     \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
       "     \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
       "     \"</p>\\n\"+\n",
       "     \"<ul>\\n\"+\n",
       "     \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
       "     \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
       "     \"</ul>\\n\"+\n",
       "     \"<code>\\n\"+\n",
       "     \"from bokeh.resources import INLINE\\n\"+\n",
       "     \"output_notebook(resources=INLINE)\\n\"+\n",
       "     \"</code>\\n\"+\n",
       "     \"</div>\"}};\n",
       "\n",
       "  function display_loaded() {\n",
       "    var el = document.getElementById(\"1001\");\n",
       "    if (el != null) {\n",
       "      el.textContent = \"BokehJS is loading...\";\n",
       "    }\n",
       "    if (root.Bokeh !== undefined) {\n",
       "      if (el != null) {\n",
       "        el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n",
       "      }\n",
       "    } else if (Date.now() < root._bokeh_timeout) {\n",
       "      setTimeout(display_loaded, 100)\n",
       "    }\n",
       "  }\n",
       "\n",
       "\n",
       "  function run_callbacks() {\n",
       "    try {\n",
       "      root._bokeh_onload_callbacks.forEach(function(callback) {\n",
       "        if (callback != null)\n",
       "          callback();\n",
       "      });\n",
       "    } finally {\n",
       "      delete root._bokeh_onload_callbacks\n",
       "    }\n",
       "    console.debug(\"Bokeh: all callbacks have finished\");\n",
       "  }\n",
       "\n",
       "  function load_libs(css_urls, js_urls, callback) {\n",
       "    if (css_urls == null) css_urls = [];\n",
       "    if (js_urls == null) js_urls = [];\n",
       "\n",
       "    root._bokeh_onload_callbacks.push(callback);\n",
       "    if (root._bokeh_is_loading > 0) {\n",
       "      console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
       "      return null;\n",
       "    }\n",
       "    if (js_urls == null || js_urls.length === 0) {\n",
       "      run_callbacks();\n",
       "      return null;\n",
       "    }\n",
       "    console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
       "    root._bokeh_is_loading = css_urls.length + js_urls.length;\n",
       "\n",
       "    function on_load() {\n",
       "      root._bokeh_is_loading--;\n",
       "      if (root._bokeh_is_loading === 0) {\n",
       "        console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n",
       "        run_callbacks()\n",
       "      }\n",
       "    }\n",
       "\n",
       "    function on_error() {\n",
       "      console.error(\"failed to load \" + url);\n",
       "    }\n",
       "\n",
       "    for (var i = 0; i < css_urls.length; i++) {\n",
       "      var url = css_urls[i];\n",
       "      const element = document.createElement(\"link\");\n",
       "      element.onload = on_load;\n",
       "      element.onerror = on_error;\n",
       "      element.rel = \"stylesheet\";\n",
       "      element.type = \"text/css\";\n",
       "      element.href = url;\n",
       "      console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n",
       "      document.body.appendChild(element);\n",
       "    }\n",
       "\n",
       "    for (var i = 0; i < js_urls.length; i++) {\n",
       "      var url = js_urls[i];\n",
       "      var element = document.createElement('script');\n",
       "      element.onload = on_load;\n",
       "      element.onerror = on_error;\n",
       "      element.async = false;\n",
       "      element.src = url;\n",
       "      console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
       "      document.head.appendChild(element);\n",
       "    }\n",
       "  };var element = document.getElementById(\"1001\");\n",
       "  if (element == null) {\n",
       "    console.error(\"Bokeh: ERROR: autoload.js configured with elementid '1001' but no matching script tag was found. \")\n",
       "    return false;\n",
       "  }\n",
       "\n",
       "  function inject_raw_css(css) {\n",
       "    const element = document.createElement(\"style\");\n",
       "    element.appendChild(document.createTextNode(css));\n",
       "    document.body.appendChild(element);\n",
       "  }\n",
       "\n",
       "  var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-1.1.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.1.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-1.1.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-1.1.0.min.js\"];\n",
       "  var css_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-1.1.0.min.css\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.1.0.min.css\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-1.1.0.min.css\"];\n",
       "\n",
       "  var inline_js = [\n",
       "    function(Bokeh) {\n",
       "      Bokeh.set_log_level(\"info\");\n",
       "    },\n",
       "    \n",
       "    function(Bokeh) {\n",
       "      \n",
       "    },\n",
       "    function(Bokeh) {} // ensure no trailing comma for IE\n",
       "  ];\n",
       "\n",
       "  function run_inline_js() {\n",
       "    \n",
       "    if ((root.Bokeh !== undefined) || (force === true)) {\n",
       "      for (var i = 0; i < inline_js.length; i++) {\n",
       "        inline_js[i].call(root, root.Bokeh);\n",
       "      }if (force === true) {\n",
       "        display_loaded();\n",
       "      }} else if (Date.now() < root._bokeh_timeout) {\n",
       "      setTimeout(run_inline_js, 100);\n",
       "    } else if (!root._bokeh_failed_load) {\n",
       "      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
       "      root._bokeh_failed_load = true;\n",
       "    } else if (force !== true) {\n",
       "      var cell = $(document.getElementById(\"1001\")).parents('.cell').data().cell;\n",
       "      cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
       "    }\n",
       "\n",
       "  }\n",
       "\n",
       "  if (root._bokeh_is_loading === 0) {\n",
       "    console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
       "    run_inline_js();\n",
       "  } else {\n",
       "    load_libs(css_urls, js_urls, function() {\n",
       "      console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n",
       "      run_inline_js();\n",
       "    });\n",
       "  }\n",
       "}(window));"
      ],
      "application/vnd.bokehjs_load.v0+json": "\n(function(root) {\n  function now() {\n    return new Date();\n  }\n\n  var force = true;\n\n  if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n    root._bokeh_onload_callbacks = [];\n    root._bokeh_is_loading = undefined;\n  }\n\n  \n\n  \n  if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n    root._bokeh_timeout = Date.now() + 5000;\n    root._bokeh_failed_load = false;\n  }\n\n  var NB_LOAD_WARNING = {'data': {'text/html':\n     \"<div style='background-color: #fdd'>\\n\"+\n     \"<p>\\n\"+\n     \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n     \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n     \"</p>\\n\"+\n     \"<ul>\\n\"+\n     \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n     \"<li>use INLINE resources instead, as so:</li>\\n\"+\n     \"</ul>\\n\"+\n     \"<code>\\n\"+\n     \"from bokeh.resources import INLINE\\n\"+\n     \"output_notebook(resources=INLINE)\\n\"+\n     \"</code>\\n\"+\n     \"</div>\"}};\n\n  function display_loaded() {\n    var el = document.getElementById(\"1001\");\n    if (el != null) {\n      el.textContent = \"BokehJS is loading...\";\n    }\n    if (root.Bokeh !== undefined) {\n      if (el != null) {\n        el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n      }\n    } else if (Date.now() < root._bokeh_timeout) {\n      setTimeout(display_loaded, 100)\n    }\n  }\n\n\n  function run_callbacks() {\n    try {\n      root._bokeh_onload_callbacks.forEach(function(callback) {\n        if (callback != null)\n          callback();\n      });\n    } finally {\n      delete root._bokeh_onload_callbacks\n    }\n    console.debug(\"Bokeh: all callbacks have finished\");\n  }\n\n  function load_libs(css_urls, js_urls, callback) {\n    if (css_urls == null) css_urls = [];\n    if (js_urls == null) js_urls = [];\n\n    root._bokeh_onload_callbacks.push(callback);\n    if (root._bokeh_is_loading > 0) {\n      console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n      return null;\n    }\n    if (js_urls == null || js_urls.length === 0) {\n      run_callbacks();\n      return null;\n    }\n    console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n    root._bokeh_is_loading = css_urls.length + js_urls.length;\n\n    function on_load() {\n      root._bokeh_is_loading--;\n      if (root._bokeh_is_loading === 0) {\n        console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n        run_callbacks()\n      }\n    }\n\n    function on_error() {\n      console.error(\"failed to load \" + url);\n    }\n\n    for (var i = 0; i < css_urls.length; i++) {\n      var url = css_urls[i];\n      const element = document.createElement(\"link\");\n      element.onload = on_load;\n      element.onerror = on_error;\n      element.rel = \"stylesheet\";\n      element.type = \"text/css\";\n      element.href = url;\n      console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n      document.body.appendChild(element);\n    }\n\n    for (var i = 0; i < js_urls.length; i++) {\n      var url = js_urls[i];\n      var element = document.createElement('script');\n      element.onload = on_load;\n      element.onerror = on_error;\n      element.async = false;\n      element.src = url;\n      console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n      document.head.appendChild(element);\n    }\n  };var element = document.getElementById(\"1001\");\n  if (element == null) {\n    console.error(\"Bokeh: ERROR: autoload.js configured with elementid '1001' but no matching script tag was found. \")\n    return false;\n  }\n\n  function inject_raw_css(css) {\n    const element = document.createElement(\"style\");\n    element.appendChild(document.createTextNode(css));\n    document.body.appendChild(element);\n  }\n\n  var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-1.1.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.1.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-1.1.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-1.1.0.min.js\"];\n  var css_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-1.1.0.min.css\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.1.0.min.css\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-1.1.0.min.css\"];\n\n  var inline_js = [\n    function(Bokeh) {\n      Bokeh.set_log_level(\"info\");\n    },\n    \n    function(Bokeh) {\n      \n    },\n    function(Bokeh) {} // ensure no trailing comma for IE\n  ];\n\n  function run_inline_js() {\n    \n    if ((root.Bokeh !== undefined) || (force === true)) {\n      for (var i = 0; i < inline_js.length; i++) {\n        inline_js[i].call(root, root.Bokeh);\n      }if (force === true) {\n        display_loaded();\n      }} else if (Date.now() < root._bokeh_timeout) {\n      setTimeout(run_inline_js, 100);\n    } else if (!root._bokeh_failed_load) {\n      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n      root._bokeh_failed_load = true;\n    } else if (force !== true) {\n      var cell = $(document.getElementById(\"1001\")).parents('.cell').data().cell;\n      cell.output_area.append_execute_result(NB_LOAD_WARNING)\n    }\n\n  }\n\n  if (root._bokeh_is_loading === 0) {\n    console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n    run_inline_js();\n  } else {\n    load_libs(css_urls, js_urls, function() {\n      console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n      run_inline_js();\n    });\n  }\n}(window));"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "output_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "from bokeh.sampledata.iris import flowers as df\n",
    "from bokeh.models import Panel, Tabs, ColumnDataSource, CustomJS"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "iris = figure(plot_width=600, plot_height=400)\n",
    "iris.circle('petal_length', 'petal_width', source=df)\n",
    "iris_tab = Panel(child=iris, title=\"iris\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "from random import random\n",
    "\n",
    "x = [random() for x in range(500)]\n",
    "y = [random() for y in range(500)]\n",
    "color = [\"navy\"] * len(x)\n",
    "\n",
    "s1 = ColumnDataSource(data=dict(x=x, y=y, color=color))\n",
    "js_interact = figure(plot_width=400, plot_height=400, tools=\"lasso_select\")\n",
    "js_interact.circle('x', 'y', color='color', size=8, alpha=0.4, source=s1, \n",
    "         selection_color=\"firebrick\", selection_alpha=0.4)\n",
    "\n",
    "s2 = ColumnDataSource(data=dict(xm=[0,1],ym=[0.5, 0.5]))\n",
    "js_interact.line(x='xm', y='ym', color=\"orange\", line_width=5, alpha=0.6, source=s2)\n",
    "\n",
    "s1.callback = CustomJS(args=dict(s1=s1, s2=s2), code=\"\"\"\n",
    "    var inds = s1.selected.indices;\n",
    "    if (inds.length == 0)\n",
    "        return;\n",
    "\n",
    "    var ym = 0\n",
    "    for (var i = 0; i < inds.length; i++) {\n",
    "        ym += s1.data.y[inds[i]]\n",
    "    }\n",
    "    \n",
    "    ym /= inds.length\n",
    "    s2.data.ym = [ym, ym]\n",
    "\n",
    "    // necessary becasue we mutated source.data in-place\n",
    "    s2.change.emit();  \n",
    "\"\"\")\n",
    "js_interact_tab = Panel(child=js_interact, title=\"js interact\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## data table\n",
    "add link to data table by [HTMLTemplateFormatter](https://bokeh.pydata.org/en/latest/docs/reference/models/widgets.tables.html#bokeh.models.widgets.tables.HTMLTemplateFormatter)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "from bokeh.models import DataTable, TableColumn, DateFormatter\n",
    "import pandas as pd\n",
    "from random import randint\n",
    "dates = pd.date_range(start='20190501',end='20190524')\n",
    "value = [randint(1,1000) for x in range(24)]\n",
    "src = ColumnDataSource(data=dict(dates=dates, value=value))\n",
    "columns = [\n",
    "    TableColumn(field=\"dates\", title=\"Date\", formatter=DateFormatter()),\n",
    "    TableColumn(field=\"value\", title=\"Value\"),\n",
    "]\n",
    "table = DataTable(source=src, columns=columns, width=400, height=300)\n",
    "table_tab = Panel(child=table, title=\"table\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"f4841197-d2eb-42d6-a1e1-a988c57f4f71\" data-root-id=\"1086\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"9ce85581-9939-4cad-a94e-541e5fb140a5\":{\"roots\":{\"references\":[{\"attributes\":{\"callback\":null,\"tabs\":[{\"id\":\"1040\",\"type\":\"Panel\"},{\"id\":\"1077\",\"type\":\"Panel\"},{\"id\":\"1085\",\"type\":\"Panel\"}]},\"id\":\"1086\",\"type\":\"Tabs\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1106\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"1105\",\"type\":\"Selection\"},{\"attributes\":{\"below\":[{\"id\":\"1011\",\"type\":\"LinearAxis\"}],\"center\":[{\"id\":\"1015\",\"type\":\"Grid\"},{\"id\":\"1020\",\"type\":\"Grid\"}],\"left\":[{\"id\":\"1016\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"renderers\":[{\"id\":\"1038\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"1087\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1027\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"1003\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"1007\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"1005\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"1009\",\"type\":\"LinearScale\"}},\"id\":\"1002\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"callback\":null,\"data\":{\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149],\"petal_length\":{\"__ndarray__\":\"ZmZmZmZm9j9mZmZmZmb2P83MzMzMzPQ/AAAAAAAA+D9mZmZmZmb2PzMzMzMzM/s/ZmZmZmZm9j8AAAAAAAD4P2ZmZmZmZvY/AAAAAAAA+D8AAAAAAAD4P5qZmZmZmfk/ZmZmZmZm9j+amZmZmZnxPzMzMzMzM/M/AAAAAAAA+D/NzMzMzMz0P2ZmZmZmZvY/MzMzMzMz+z8AAAAAAAD4PzMzMzMzM/s/AAAAAAAA+D8AAAAAAADwPzMzMzMzM/s/ZmZmZmZm/j+amZmZmZn5P5qZmZmZmfk/AAAAAAAA+D9mZmZmZmb2P5qZmZmZmfk/mpmZmZmZ+T8AAAAAAAD4PwAAAAAAAPg/ZmZmZmZm9j8AAAAAAAD4PzMzMzMzM/M/zczMzMzM9D9mZmZmZmb2P83MzMzMzPQ/AAAAAAAA+D/NzMzMzMz0P83MzMzMzPQ/zczMzMzM9D+amZmZmZn5P2ZmZmZmZv4/ZmZmZmZm9j+amZmZmZn5P2ZmZmZmZvY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mZmZmYGQAAAAAAAAAhAMzMzMzMzB0DNzMzMzMwEQDMzMzMzMwNAMzMzMzMzA0CamZmZmZkFQJqZmZmZmQVAAAAAAAAACEAzMzMzMzMLQM3MzMzMzAhAZmZmZmZmAkAAAAAAAAAIQAAAAAAAAARAzczMzMzMBEAAAAAAAAAIQM3MzMzMzARAZmZmZmZmAkCamZmZmZkFQAAAAAAAAAhAMzMzMzMzB0AzMzMzMzMHQAAAAAAAAARAZmZmZmZmBkBmZmZmZmYKQJqZmZmZmQVAAAAAAAAACEAzMzMzMzMHQAAAAAAAAAhAAAAAAAAACEAAAAAAAAAEQDMzMzMzMwdAAAAAAAAABEDNzMzMzMwMQJqZmZmZmQlAmpmZmZmZBUAAAAAAAAAIQAAAAAAAAARAZmZmZmZmBkCamZmZmZkJQAAAAAAAAAhAZmZmZmZmDkDNzMzMzMwEQJqZmZmZmQFAmpmZmZmZCUBmZmZmZmYGQGZmZmZmZgZAmpmZmZmZBUBmZmZmZmYKQJqZmZmZmQlAZmZmZmZmBkAAAAAAAAAIQGZmZmZmZgZAAAAAAAAACEBmZmZmZmYGQGZmZmZmZg5AZmZmZmZmBkBmZmZmZmYGQM3MzMzMzARAAAAAAAAACEAzMzMzMzMLQM3MzMzMzAhAAAAAAAAACEDNzMzMzMwIQM3MzMzMzAhAzczMzMzMCECamZmZmZkFQJqZmZmZmQlAZmZmZmZmCkAAAAAAAAAIQAAAAAAAAARAAAAAAAAACEAzMzMzMzMLQAAAAAAAAAhA\",\"dtype\":\"float64\",\"shape\":[150]},\"species\":[\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\"]},\"selected\":{\"id\":\"1105\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1104\",\"type\":\"UnionRenderers\"}},\"id\":\"1034\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"petal_length\"},\"y\":{\"field\":\"petal_width\"}},\"id\":\"1036\",\"type\":\"Circle\"},{\"attributes\":{\"callback\":null},\"id\":\"1003\",\"type\":\"DataRange1d\"},{\"attributes\":{\"callback\":null},\"id\":\"1005\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1007\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1009\",\"type\":\"LinearScale\"},{\"attributes\":{\"formatter\":{\"id\":\"1091\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1012\",\"type\":\"BasicTicker\"}},\"id\":\"1011\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1012\",\"type\":\"BasicTicker\"},{\"attributes\":{\"ticker\":{\"id\":\"1012\",\"type\":\"BasicTicker\"}},\"id\":\"1015\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1017\",\"type\":\"BasicTicker\"},{\"attributes\":{\"dimension\":1,\"ticker\":{\"id\":\"1017\",\"type\":\"BasicTicker\"}},\"id\":\"1020\",\"type\":\"Grid\"},{\"attributes\":{\"source\":{\"id\":\"1034\",\"type\":\"ColumnDataSource\"}},\"id\":\"1039\",\"type\":\"CDSView\"},{\"attributes\":{\"child\":{\"id\":\"1002\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"title\":\"iris\"},\"id\":\"1040\",\"type\":\"Panel\"},{\"attributes\":{},\"id\":\"1021\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"1022\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"overlay\":{\"id\":\"1106\",\"type\":\"BoxAnnotation\"}},\"id\":\"1023\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"1024\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1025\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"1026\",\"type\":\"HelpTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1021\",\"type\":\"PanTool\"},{\"id\":\"1022\",\"type\":\"WheelZoomTool\"},{\"id\":\"1023\",\"type\":\"BoxZoomTool\"},{\"id\":\"1024\",\"type\":\"SaveTool\"},{\"id\":\"1025\",\"type\":\"ResetTool\"},{\"id\":\"1026\",\"type\":\"HelpTool\"}]},\"id\":\"1027\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1110\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1109\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"1034\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1036\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1037\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"1039\",\"type\":\"CDSView\"}},\"id\":\"1038\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"petal_length\"},\"y\":{\"field\":\"petal_width\"}},\"id\":\"1037\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1108\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1104\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1102\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1103\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1107\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"line_alpha\":0.6,\"line_color\":\"orange\",\"line_width\":5,\"x\":{\"field\":\"xm\"},\"y\":{\"field\":\"ym\"}},\"id\":\"1072\",\"type\":\"Line\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1089\",\"type\":\"Title\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"line_width\":5,\"x\":{\"field\":\"xm\"},\"y\":{\"field\":\"ym\"}},\"id\":\"1073\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1093\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data_source\":{\"id\":\"1070\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1072\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1073\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"1075\",\"type\":\"CDSView\"}},\"id\":\"1074\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"1070\",\"type\":\"ColumnDataSource\"}},\"id\":\"1075\",\"type\":\"CDSView\"},{\"attributes\":{\"child\":{\"id\":\"1042\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"title\":\"js interact\"},\"id\":\"1077\",\"type\":\"Panel\"},{\"attributes\":{},\"id\":\"1091\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"xs_units\":\"screen\",\"ys_units\":\"screen\"},\"id\":\"1111\",\"type\":\"PolyAnnotation\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1087\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"1099\",\"type\":\"StringEditor\"},{\"attributes\":{},\"id\":\"1101\",\"type\":\"StringFormatter\"},{\"attributes\":{\"callback\":null,\"data\":{\"xm\":[0,1],\"ym\":[0.5,0.5]},\"selected\":{\"id\":\"1110\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1109\",\"type\":\"UnionRenderers\"}},\"id\":\"1070\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"below\":[{\"id\":\"1051\",\"type\":\"LinearAxis\"}],\"center\":[{\"id\":\"1055\",\"type\":\"Grid\"},{\"id\":\"1060\",\"type\":\"Grid\"}],\"left\":[{\"id\":\"1056\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"1068\",\"type\":\"GlyphRenderer\"},{\"id\":\"1074\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"1089\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1062\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"1043\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"1047\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"1045\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"1049\",\"type\":\"LinearScale\"}},\"id\":\"1042\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"callback\":null},\"id\":\"1043\",\"type\":\"DataRange1d\"},{\"attributes\":{\"callback\":{\"id\":\"1076\",\"type\":\"CustomJS\"},\"data\":{\"color\":[\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\"],\"x\":[0.935953469242775,0.034017008781427105,0.2485670936217096,0.48422841014303974,0.7544398734640735,0.27335417037622867,0.5636094454487772,0.5524448057145837,0.4504367393831904,0.356620063957923,0.7991001929842937,0.9887800146858721,0.07249574606613074,0.8218306387105008,0.10886810001698954,0.04710348315295865,0.9827618589820571,0.8713246958321508,0.5526872866332749,0.5763859782632558,0.4420372638052116,0.5771505852996568,0.18329062656586548,0.4065133877425987,0.6531535405468702,0.28295734127300953,0.14586383108841927,0.31080928049987455,0.9979069546986105,0.11563401518106153,0.2504165689997202,0.4582429521703665,0.7560615981519155,0.9478890414894441,0.8807358646270809,0.4655093677457952,0.6892772500237594,0.5773684112066223,0.21546498233016276,0.8160385169896412,0.5642184109766145,0.22265362777230813,0.3768713986845905,0.1015614324104247,0.2003809633503797,0.026798801895670077,0.16634412777963759,0.3453084205926533,0.7638043483579127,0.014831328653798881,0.19084562008002626,0.6476589833189645,0.568339728556428,0.11477959245524583,0.5790866565188569,0.36559782238907235,0.05118609187110412,0.9592576724725217,0.8819182974560381,0.6051656962271058,0.1680911696044134,0.04885078734561821,0.014841738305525265,0.3342108518176191,0.15869772830668605,0.14684572217755676,0.19009555276281753,0.6000658706565102,0.7305896139869743,0.3535170011195955,0.9776164078176597,0.5354610075273715,0.08804760585857363,0.7034129743663248,0.8318101106027345,0.5547669477261743,0.6876884487819575,0.8193345090372899,0.2635417744496943,0.9208564972951567,0.5290129187666396,0.9655972530612987,0.9909761669477319,0.5133359866121218,0.9204382368350363,0.33058631917487113,0.40587582908944797,0.3237618116502128,0.9464013775684911,0.23334607890293124,0.771681168627527,0.8260163336556886,0.629758830767969,0.1862407183340704,0.5153933642086649,0.7880933969906737,0.0601668462116185,0.7357121609496035,0.021415858832779744,0.07448730622529232,0.758124805740871,0.19293871707734733,0.5948637489408429,0.4804004834525649,0.8416552973021969,0.12793123699302056,0.5925502668552934,0.8479916380651216,0.8982078749623379,0.9975012715866649,0.6592529305602234,0.8355947547159215,0.5146513654486519,0.13962898075755703,0.613648487116433,0.496678630594134,0.8345768005441851,0.38376401824608497,0.3689130748476561,0.2730026765746314,0.2560543509878408,0.58534739776787,0.11019564197673237,0.32556459258854376,0.36595024941285603,0.4642714166248967,0.50692482619252,0.7972085458540762,0.7633394668769118,0.2035818440467304,0.3179684791426173,0.38304910287103844,0.9864016268832158,0.04096952604924231,0.08945640186815773,0.13848673359728703,0.9537055398962428,0.33756346279927074,0.6837046154548743,0.5899549064000226,0.8177476340322807,0.021841469416801096,0.1847793836648417,0.2553885750329189,0.05466319741124881,0.32088935440612976,0.6469936024731721,0.16126159642015458,0.32472455667229594,0.5754022063863569,0.11057535076670033,0.25710488137714393,0.09825303801725926,0.6443611104421578,0.44699183371924545,0.5807364078481645,0.8742817399359313,0.6709493823877598,0.6822167270878566,0.1942831050758751,0.10571252839348844,0.5581603053630454,0.5594451958601863,0.6025229594658537,0.9054862971092307,0.12302573744222534,0.7608004042384979,0.1905221676452179,0.4944314186477805,0.9212001851392656,0.7081625846852718,0.4451856406138597,0.8994300048676602,0.2539990112612881,0.8715728690268254,0.6020773610863549,0.4511281658865355,0.6868165168869316,0.5462301959523721,0.23959572690044595,0.6002166046654609,0.5369392877508665,0.922349676561739,0.7777489542209548,0.03320185111476026,0.777712647088509,0.41310099595684624,0.7386760488611314,0.7520845416037686,0.6190910711970636,0.34795988979036496,0.02509079065896891,0.7913049300767994,0.15095066176988103,0.822500241551657,0.7241849606127813,0.9137569028153907,0.9291270205698796,0.17973131604682657,0.45513696969093653,0.47744398965032486,0.8201558271365772,0.19381066042453188,0.8306521189471852,0.6072722409012845,0.5456064217302508,0.5637013884009393,0.6161035844415365,0.9309876737886232,0.901719580635893,0.3162369439191127,0.4338290179236096,0.09643337323173995,0.9146215110797998,0.25536933376814686,0.7874912580890076,0.33393952984985065,0.3916466325272002,0.45023141445375836,0.16268535603242362,0.06359778110558256,0.25787169333791393,0.38117722884698224,0.5196800833774948,0.5554944435121341,0.6450473365304782,0.12299450099079157,0.12526137570240858,0.21426942081542744,0.9479595384952395,0.4667502469493945,0.11392486806352198,0.8650962353207722,0.7003322527812451,0.2845499802513992,0.36776065256964385,0.7195383404820636,0.7721101380381074,0.7826496103183824,0.22387636741382977,0.08077136858057565,0.029831767747848903,0.5546242877940054,0.3374532356712706,0.2547019756975729,0.8843815449055298,0.39119490610877494,0.31892289557684184,0.6177671010636255,0.6868985070021896,0.7468747768392665,0.7866890199413402,0.415767872949113,0.8433236874844796,0.7942327681574429,0.08223308175437538,0.36855224901281425,0.7732244528561127,0.15288895100423772,0.4482717186231596,0.05962692028717009,0.06713125696117017,0.7063809446792854,0.5513777178153245,0.2790681649722495,0.7309438657505403,0.12639195739941578,0.5073857429871179,0.04923071234954168,0.4304397026598932,0.9052608811244417,0.9511107975244717,0.005896901263759302,0.6771982879764485,0.06982840598584705,0.09687585283470768,0.9920490318799147,0.07843693674921037,0.606690353721527,0.7868968225356416,0.9292691689611626,0.22154199834735655,0.017549568178309993,0.9764100853456723,0.4981984628729572,0.5828517983345086,0.051392194060187024,0.3113365893117236,0.06887622362003465,0.30789190524876275,0.9791683134869769,0.3405151110460838,0.4905551488288563,0.16098521067174398,0.48339859188639545,0.6755880711713154,0.15129476515703333,0.8593912428511244,0.31026739892479693,0.2894329628517428,0.2533655647477714,0.1597572553853901,0.8487091728464528,0.20114624906880907,0.8982712715552129,0.15416202463816664,0.5753753678045194,0.6170112407189269,0.07330903002629197,0.2548598643679516,0.49908009265423037,0.955728201666895,0.8823170304431618,0.3307446436366669,0.5563577605087702,0.14778642840293543,0.9442613829704661,0.1120232487267131,0.577198607719944,0.10660989604974946,0.21666771648947947,0.37996267440173026,0.8886837664766047,0.8546521863241584,0.8533276815804838,0.8403595556863089,0.922751000296794,0.5222361628574098,0.2691520083347857,0.7795502005265323,0.4800716788145334,0.6634587236602391,0.9538672038026675,0.8468054468711145,0.6071340015309395,0.368996972007138,0.16045486279781251,0.4977855017137335,0.12492801428892653,0.967434525452799,0.5205816191663076,0.5132903691773224,0.17554399343892602,0.4443650324990661,0.32550578224427507,0.18688855618762656,0.6416403078860754,0.49158783250257054,0.6276643135153821,0.9536393210466575,0.4826842330508153,0.8732390915408732,0.5257268611540958,0.024382081598781413,0.9682894986734426,0.7461926283301834,0.7041515860030906,0.5858039935963557,0.026912866747273667,0.4709538765777257,0.5847847744188579,0.9829590934702452,0.23159063241320244,0.1646168187490371,0.9882940498147346,0.3205233193753515,0.35351803000788307,0.48062795865257957,0.16465795641067993,0.02447472053636468,0.027945058205359974,0.8081557049509859,0.5652119987292101,0.21171172574821606,0.2829309045766857,0.8502831085012634,0.2714881837602757,0.41044924513458847,0.9899714550005877,0.9195046514486666,0.5723674603073504,0.9326819475738204,0.04370731992817223,0.16435975937020542,0.14002123470886496,0.005453751135682472,0.6929556800915784,0.3348903495744876,0.29529769035434317,0.5904195280015686,0.8991377497046493,0.18448983807488284,0.042581099337174355,0.49014253849169687,0.7399622690859162,0.40431594911577584,0.010121182623827107,0.2530116174564484,0.6664155909546239,0.4302297148788399,0.9087472074852702,0.39866716801605584,0.9651398325786678,0.390109777680697,0.8004094979095249,0.44759404715296636,0.8200194787950504,0.014707159945477333,0.21424678521936136,0.8060845969436176,0.008178744289870865,0.8497528926953891,0.8831584604211365,0.49000460673100255,0.30024794303462643,0.37444201999083304,0.47367805963334975,0.07620771444377616,0.5467748049398907,0.0426237338885751,0.6803019588444548,0.07563973900333587,0.4678488863080975,0.46503974991685804,0.14137751222259376,0.699525972306966,0.8829938420957391,0.6878497694999387,0.8041355789776174,0.050220052106078605,0.2598687718573063,0.48191664598531014,0.5066657810903691,0.2397506874771288,0.043832561949827986,0.29994535673745637,0.11965958290018619,0.18532197221645463,0.7677545643713123,0.11713455914971571,0.09867477192129159,0.05518161754940787,0.8761496294941762,0.8615568588150273,0.1278704490860273,0.7019332389835514,0.07834376533282239,0.8500202004604477,0.7598756163295093,0.29121488607726065,0.5325355619330463,0.03797980708653048,0.40114654882191414,0.002185400351079725,0.10837449400539945,0.5206982328042165,0.699872923202735,0.41625202748026846,0.4018479896778653,0.8079342162957219,0.09156023959635884,0.7136142628449569,0.8934798166005385,0.46821323364810885,0.7634154570533841,0.16033662615395539,0.6945211044485464,0.7357944039319353,0.49846626207567546,0.542987593489629,0.505719584890394,0.9653414372154774,0.6533237551684461,0.09783524714408909,0.14612185812586742,0.4513746673747422,0.12454524735461481,0.24901259185618962,0.7345681811658893,0.1614390332622273,0.5369962354888362,0.980790630867582,0.8141097343366953,0.03494991954915516,0.8272998197536984,0.38112791927478873,0.23612613097341106,0.05780038539826826,0.9029497094928319,0.5159139909666863,0.36576642411718396,0.7770451152748284,0.8327676794329898,0.5477174497623459,0.006959099499106891,0.3744250671463376,0.9479269297131029,0.1487453317881533,0.4882437370817513,0.5170983150515002],\"y\":[0.44143929859006614,0.6972021122024096,0.40578256225223786,0.3929116319085524,0.294056020839111,0.8597568358559599,0.9616664403361369,0.6639200087116962,0.15184917221990368,0.7348123887294603,0.6734589626643657,0.18980634352717618,0.602524718625071,0.3750233347187756,0.8039468275495115,0.23334406331379398,0.4490165468140902,0.9480567176368209,0.24675757150095945,0.4779579447328445,0.9219930928328299,0.020643536960030517,0.2744959591982652,0.8266505201041442,0.22228567542058897,0.22232852832013705,0.013617905020213428,0.21913472984378202,0.9100172167250458,0.20872691597147275,0.4459006122409881,0.45050749190899997,0.37202599473606723,0.18899769024268354,0.03030231950596851,0.6004056175737487,0.9202451435990863,0.34488348159605287,0.746124280252862,0.6300490627259399,0.13120064357233518,0.584580072881013,0.7164238420686774,0.15327324204802073,0.8876181027070514,0.7220751591987693,0.40624250189291244,0.6915970414279916,0.4299327072207112,0.9811496463376657,0.26625351756611526,0.35457055353578093,0.15105093361768818,0.5747615850782787,0.30225481512231367,0.29228351278531806,0.115919349341152,0.28340213792337876,0.7623316774783303,0.19830258577304205,0.5879182684027259,0.3323220680595421,0.36426756280258954,0.5630933568955746,0.9415732254136567,0.9564986825200601,0.2762970185899787,0.6908969664239866,0.2025865772765626,0.8434877604912951,0.2431332589227655,0.854107942730557,0.854134645349599,0.7220097268194823,0.7300187122005997,0.44777468433631296,0.7819546586588219,0.004983028865492178,0.12971962075836208,0.3304981868094201,0.9253129219020578,0.6226146827156182,0.8632254225947598,0.5024087661154661,0.0038038680519478785,0.817901012747848,0.5393365122905011,0.770503318420421,0.9299468188140141,0.6762158912209356,0.3970209189208238,0.7599962667225334,0.225945257278362,0.9133082541284379,0.3950839466859738,0.6589525495714182,0.4568515019185565,0.5204434117011809,0.9373804774113174,0.17037161086198316,0.8512280429630086,0.9621364577964343,0.47397415134460397,0.8050561526719497,0.5078381355215396,0.20450611012614328,0.8479262975958987,0.9853146647532083,0.9938008949740624,0.14640691072752343,0.07640173961924313,0.3943548643160436,0.6143126370187882,0.0036081454371899024,0.8292930427337771,0.1255948822008841,0.7383380282834979,0.801323656373088,0.6154143556783112,0.5585675279264265,0.7624323014400206,0.2702176435141279,0.7425660015486908,0.11808298617478752,0.6328910867806172,0.44285770430517535,0.3151829504892433,0.36936533775047176,0.9381187347201203,0.8817532053876167,0.35263772354673684,0.3728597131706304,0.3865981091305861,0.3829619617295753,0.22767484719531061,0.13857615762621955,0.2531502124879049,0.2723263867240432,0.5415203826502866,0.0002422291899794038,0.13053823516440377,0.3897000274015471,0.27951784919503553,0.0748925426466377,0.6499399017519658,0.12978445804670546,0.37085685132280966,0.15429913362814884,0.612815700614876,0.5654124631360014,0.18535644560865927,0.41793775124948185,0.8521525922168228,0.5088596832497029,0.26189958241307854,0.377084794579834,0.9614169303382395,0.34736502754490073,0.8934393271150196,0.4066487235587224,0.5061713256225115,0.9057585910357933,0.9341913947744496,0.3580882073034951,0.584355735286083,0.9165447602507588,0.06801605019267976,0.8902820007088859,0.13605395603769965,0.07941157960871259,0.7551685343696631,0.5639546903225309,0.5317498573546314,0.49085337683746344,0.35648247603975836,0.11370689035678916,0.8289894357388805,0.15098002958857237,0.5434124985372873,0.9899446236614927,0.7518455570766882,0.38769149699222105,0.4435321515429511,0.0882818645753023,0.9116439962523823,0.21366337291575943,0.41297982959882074,0.07717427621135009,0.3373400026428637,0.013342211343939092,0.12314961829962023,0.15827002432420956,0.05081261174995755,0.6763975604059352,0.48330055069717837,0.6679360432021362,0.1683654162506586,0.7151821726502076,0.10577664380543539,0.5871803174694775,0.03978080522556893,0.5304655340090139,0.9641184021711605,0.0808518179856611,0.9806858468965661,0.5186093726973975,0.5850801762836999,0.20555255036889808,0.7065892230943267,0.6748501676495511,0.9324350814064825,0.5616109512277564,0.8854761574907515,0.35240746215295293,0.7114045994623577,0.021285239203086892,0.20916064738477924,0.7761998108364526,0.23572683931479543,0.6012688049890494,0.7084899089843073,0.5417486243716597,0.9914987547906613,0.16528543824920905,0.9193004062604819,0.5211990244211788,0.5663097609960309,0.7051728854447383,0.9828240074567296,0.6684112326111545,0.9656770144525386,0.2075528166775189,0.21072746606365722,0.9733107179344529,0.6367536997487382,0.028286073379231724,0.777336186316432,0.6970454538104432,0.625626003410012,0.5660664374414245,0.6657011598377353,0.28276523036400825,0.6052891110349954,0.7838316311812444,0.37820021277044424,0.8973133038229376,0.5093393923855252,0.4568239810643743,0.6123365653801853,0.5011919157009339,0.4795165021668871,0.6498339673424934,0.8564302449386966,0.7373973881035435,0.9839696714117198,0.3368099773177484,0.158021617923212,0.9100421579992226,0.16920874822836385,0.5392223260019333,0.5559788107187901,0.18783107528869758,0.03250553872189621,0.5515861611603409,0.4553345051475053,0.19846730394370204,0.2817163468010925,0.9220536462097434,0.8990735962203057,0.4171180561265918,0.9664509641408059,0.37372271977308447,0.5285011269621664,0.7335972870995358,0.8200297593142242,0.17955426684585318,0.21054141352392142,0.19317497126345573,0.6218082306702631,0.2303684636155683,0.4948216361173978,0.18735804246908672,0.7374694023433424,0.9800056702552303,0.6424604226675942,0.7239952577999658,0.9468832461741252,0.4297638825136293,0.373279418314838,0.14395951438440457,0.6133991788642619,0.32613819541380196,0.20071938372091735,0.5187188596460952,0.9837566830270505,0.31953694852903725,0.49098870721310006,0.5364273920754508,0.40112387111146963,0.6733171516811268,0.0003477675707398431,0.524786556384003,0.2848748482651292,0.4283057889918651,0.8869058839112337,0.42028069224010767,0.08340772820189046,0.9027157700013327,0.003880367860386369,0.13466701126762248,0.8355057949671851,0.6375889188666183,0.7794284809413649,0.5680709876570963,0.17337571211729397,0.5418786768674736,0.11821669028623438,0.7820447561383396,0.8870140974776564,0.5272107613456816,0.5399782456215704,0.6962200069529623,0.5568834991961007,0.8843635798800877,0.9332373390197105,0.8121381280252703,0.4430285897755999,0.7552771267896436,0.3336643764762114,0.2351480857263013,0.5762602600157135,0.12268518278798046,0.18190134796571855,0.12599029134910733,0.3304856144843987,0.4796218488455538,0.41542836972552044,0.11658040198123809,0.30042980225973837,0.4210847705819888,0.16624553349810256,0.4333022904942234,0.10409589700878408,0.6157811352998631,0.9186771227712748,0.8286589091934211,0.7333433956532598,0.2932864502444398,0.5872724333571323,0.9374069112253786,0.2324277371852418,0.20092932953722953,0.32626409824755176,0.42629935502561533,0.6965983978928463,0.1761328339136421,0.5344810389885933,0.08731699902730361,0.15150594044517884,0.39568902560733765,0.22792879177070968,0.9545499715456014,0.9320430794239548,0.5763254421974187,0.20112605460669952,0.11680388422085586,0.027469786545367025,0.9479760134170229,0.5698082049285254,0.6080798117933044,0.14021313394983503,0.03845517735286652,0.4324477626753297,0.894456469588578,0.6039632171774687,0.6501353755296071,0.11001833964173058,0.6005710279155142,0.22791236248191582,0.950069351583226,0.5054196136321255,0.7094668723629278,0.8205602642775468,0.5705920246314669,0.8139372563868211,0.6088355526543644,0.29585108788987147,0.561094999689841,0.15998397097898664,0.6543994004656049,0.5262001553086497,0.045420064452061704,0.9494170600891737,0.4219041564668524,0.028770517379532734,0.20603536595222682,0.09326749753697394,0.2781084141360177,0.8053272151973438,0.7716444416673911,0.24974624448433025,0.9418451676097506,0.47540604016121857,0.18552651191836478,0.4292236451177792,0.848115200500046,0.3200529891579251,0.5472575888194495,0.156342278585065,0.7676416110222367,0.056236893379653985,0.4717303306459585,0.5606359795039133,0.14724603180582851,0.04878000019414719,0.9658969018629082,0.9219798363382214,0.9714397477379842,0.7544292427735438,0.389267323501412,0.21987932617792094,0.22263638019157617,0.15433015167071396,0.1515132890513754,0.9624804964522768,0.5574080681948715,0.7593725335688808,0.07428457074091388,0.4946664569244843,0.5652542381732938,0.812866863283891,0.11921837129471291,0.26778284225782645,0.6616346424611961,0.8611849919652459,0.7000158374424231,0.20017476620212427,0.5945946026118595,0.6470930550706953,0.7192549041417471,0.30365558678262494,0.22665764366406638,0.024810972103799456,0.8148475728368612,0.8051389391656713,0.7043459968311324,0.12028412671281885,0.15458435171945306,0.19096133358509504,0.6487090381030037,0.12798907203452348,0.5255366664686767,0.6868395225824041,0.4168574530464171,0.6482564603441195,0.7538710851779962,0.721931135360221,0.07938964351846256,0.6000288871130351,0.05760969947946282,0.9601937028324835,0.9024745389368087,0.26627689613071037,0.7079990226061448,0.34215727873160073,0.6655629612040954,0.751862703235485,0.04612832065426686,0.3030154912584355,0.38218643433164046,0.9865849351930236,0.5783602218417251,0.6906393760150386,0.3948509959311195,0.031350242638389925,0.722313088315105,0.35290961244382235,0.7129176838488089,0.8660707138067962,0.6196756389161111,0.09030867352084249,0.7616621133331383,0.05398845724063328,0.07000861878699416,0.9980584380744489,0.20787281827683046,0.08128079750349515,0.15079106433545608,0.05492023306630922,0.9900959588086042,0.1878302342424758,0.19734997643677799,0.6854835556378036,0.17169374751491517,0.3432328889091021,0.8646586391261332,0.012329361261840921,0.7701963496557758,0.4637347821120431,0.16889543202122526]},\"selected\":{\"id\":\"1108\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1107\",\"type\":\"UnionRenderers\"}},\"id\":\"1041\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1097\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null},\"id\":\"1045\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1047\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1049\",\"type\":\"LinearScale\"},{\"attributes\":{\"columns\":[{\"id\":\"1080\",\"type\":\"TableColumn\"},{\"id\":\"1082\",\"type\":\"TableColumn\"}],\"height\":300,\"source\":{\"id\":\"1078\",\"type\":\"ColumnDataSource\"},\"view\":{\"id\":\"1084\",\"type\":\"CDSView\"},\"width\":400},\"id\":\"1083\",\"type\":\"DataTable\"},{\"attributes\":{\"formatter\":{\"id\":\"1095\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1052\",\"type\":\"BasicTicker\"}},\"id\":\"1051\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1079\",\"type\":\"DateFormatter\"},{\"attributes\":{},\"id\":\"1052\",\"type\":\"BasicTicker\"},{\"attributes\":{\"ticker\":{\"id\":\"1052\",\"type\":\"BasicTicker\"}},\"id\":\"1055\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"1097\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1057\",\"type\":\"BasicTicker\"}},\"id\":\"1056\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1057\",\"type\":\"BasicTicker\"},{\"attributes\":{\"dimension\":1,\"ticker\":{\"id\":\"1057\",\"type\":\"BasicTicker\"}},\"id\":\"1060\",\"type\":\"Grid\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1061\",\"type\":\"LassoSelectTool\"}]},\"id\":\"1062\",\"type\":\"Toolbar\"},{\"attributes\":{\"callback\":null,\"data\":{\"dates\":{\"__ndarray__\":\"AADADQundkIAAIBzXad2QgAAQNmvp3ZCAAAAPwKodkIAAMCkVKh2QgAAgAqnqHZCAABAcPmodkIAAADWS6l2QgAAwDueqXZCAACAofCpdkIAAEAHQ6p2QgAAAG2VqnZCAADA0ueqdkIAAIA4Oqt2QgAAQJ6Mq3ZCAAAABN+rdkIAAMBpMax2QgAAgM+DrHZCAABANdasdkIAAACbKK12QgAAwAB7rXZCAACAZs2tdkIAAEDMH652QgAAADJyrnZC\",\"dtype\":\"float64\",\"shape\":[24]},\"value\":[914,231,344,885,399,927,815,696,344,923,522,903,979,715,235,713,983,334,412,543,465,651,987,235]},\"selected\":{\"id\":\"1103\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1102\",\"type\":\"UnionRenderers\"}},\"id\":\"1078\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"editor\":{\"id\":\"1099\",\"type\":\"StringEditor\"},\"field\":\"dates\",\"formatter\":{\"id\":\"1079\",\"type\":\"DateFormatter\"},\"title\":\"Date\"},\"id\":\"1080\",\"type\":\"TableColumn\"},{\"attributes\":{\"callback\":null,\"overlay\":{\"id\":\"1111\",\"type\":\"PolyAnnotation\"}},\"id\":\"1061\",\"type\":\"LassoSelectTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.4},\"fill_color\":{\"field\":\"color\"},\"line_alpha\":{\"value\":0.4},\"line_color\":{\"field\":\"color\"},\"size\":{\"units\":\"screen\",\"value\":8},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1065\",\"type\":\"Circle\"},{\"attributes\":{\"editor\":{\"id\":\"1100\",\"type\":\"StringEditor\"},\"field\":\"value\",\"formatter\":{\"id\":\"1101\",\"type\":\"StringFormatter\"},\"title\":\"Value\"},\"id\":\"1082\",\"type\":\"TableColumn\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":8},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1066\",\"type\":\"Circle\"},{\"attributes\":{\"child\":{\"id\":\"1083\",\"type\":\"DataTable\"},\"title\":\"table\"},\"id\":\"1085\",\"type\":\"Panel\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.4},\"fill_color\":{\"value\":\"firebrick\"},\"line_alpha\":{\"value\":0.4},\"line_color\":{\"value\":\"firebrick\"},\"size\":{\"units\":\"screen\",\"value\":8},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1067\",\"type\":\"Circle\"},{\"attributes\":{\"source\":{\"id\":\"1078\",\"type\":\"ColumnDataSource\"}},\"id\":\"1084\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"1041\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1065\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1066\",\"type\":\"Circle\"},\"selection_glyph\":{\"id\":\"1067\",\"type\":\"Circle\"},\"view\":{\"id\":\"1069\",\"type\":\"CDSView\"}},\"id\":\"1068\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"formatter\":{\"id\":\"1093\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1017\",\"type\":\"BasicTicker\"}},\"id\":\"1016\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1100\",\"type\":\"StringEditor\"},{\"attributes\":{\"source\":{\"id\":\"1041\",\"type\":\"ColumnDataSource\"}},\"id\":\"1069\",\"type\":\"CDSView\"},{\"attributes\":{\"args\":{\"s1\":{\"id\":\"1041\",\"type\":\"ColumnDataSource\"},\"s2\":{\"id\":\"1070\",\"type\":\"ColumnDataSource\"}},\"code\":\"\\n    var inds = s1.selected.indices;\\n    if (inds.length == 0)\\n        return;\\n\\n    var ym = 0\\n    for (var i = 0; i < inds.length; i++) {\\n        ym += s1.data.y[inds[i]]\\n    }\\n    \\n    ym /= inds.length\\n    s2.data.ym = [ym, ym]\\n\\n    // necessary becasue we mutated source.data in-place\\n    s2.change.emit();  \\n\"},\"id\":\"1076\",\"type\":\"CustomJS\"},{\"attributes\":{},\"id\":\"1095\",\"type\":\"BasicTickFormatter\"}],\"root_ids\":[\"1086\"]},\"title\":\"Bokeh Application\",\"version\":\"1.1.0\"}};\n",
       "  var render_items = [{\"docid\":\"9ce85581-9939-4cad-a94e-541e5fb140a5\",\"roots\":{\"1086\":\"f4841197-d2eb-42d6-a1e1-a988c57f4f71\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        embed_document(root);\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "      attempts++;\n",
       "      if (attempts > 100) {\n",
       "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "1086"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "show(Tabs(tabs=[iris_tab, js_interact_tab, table_tab]))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
